(global.webpackJsonp = global.webpackJsonp || []).push([ [ "xg_o2o/order/orderdetail" ], {
    "0d0d": function(e, t, i) {
        "use strict";
        (function(e) {
            Object.defineProperty(t, "__esModule", {
                value: !0
            }), t.default = void 0;
            var a = i("b00d"), o = {
                data: function() {
                    return {
                        bgColor: "",
                        textColor: "",
                        tabHeight: 200,
                        graceFullLoading: !0,
                        orderId: 0,
                        orderDetail: {},
                        addressDetail: {},
                        cancelTime: "",
                        payTime: "",
                        dispatchTime: "",
                        finishTime: "",
                        gradeTime: "",
                        personnelName: "",
                        personnelMobile: "",
                        grade: 0,
                        grade_remarks: "",
                        isRes: !1,
                        isPay: !1,
                        isRefundBtn: !1,
                        userWxInfo: {},
                        uploadimgs: "",
                        peruploadimgs: "",
                        addGoods: "配件",
                        goodsSelectList: [],
                        totalprice: 0,
                        allprice: 0,
                        cusset: [],
                        sceneid: 0,
                        showadmin: !1,
                        usermobile: "",
                        userpword: "",
                        iskefu: 2,
                        showHead: 1,
                        headimg: "",
                        teckname: "技师",
                        perStar: 0,
                        showBack: !1,
                        showTel: 1,
                        allpay: 0,
                        isTail: 0,
                        isShowTeck: 0,
                        refundType: "",
                        refundReason: "",
                        cancelName: "",
                        refundPlaceholder: "",
                        showname: "",
                        iscommentpic: 2,
                        uploadServerUrl: "",
                        selectedimgs: [],
                        gradeimgs: "",
                        gradeShowImgs: [],
                        selectTags: [],
                        tags: [],
                        orderTags: [],
                        tailserv: "服务费",
                        tailmate: "材料费",
                        showother: 2
                    };
                },
                onLoad: function(e) {
                    this.uploadServerUrl = this.$xRequest.url("entry/wxapp/v4uploadimg");
                    var t = a.d;
                    this.showname = "wx5a67ffb91ef175cb" == t || "wxcaad2fca5f5aeba1" == t ? "昵称" : "姓名", 
                    "wx2285aa24a7029f46" != t && "wxcaad2fca5f5aeba1" != t || (this.showother = 1);
                    var i = getCurrentPages();
                    if (this.showBack = i.length > 1, e.scene) {
                        var o = decodeURIComponent(e.scene).split("&")[0].split("=");
                        "id" == o[0] && o[1] > 0 && (this.graceFullLoading = !1, this.sceneid = o[1], this.showadmin = !0);
                    } else {
                        this.orderId = e.oid;
                        var s = this.$systemInfo.info();
                        this.tabHeight = s.windowHeight - s.iPhoneXBottomHeightPx - 65, this.detailData();
                    }
                },
                methods: {
                    tapInfo: function(e) {
                        -1 == this.selectTags.indexOf(e) ? this.selectTags.push(e) : this.selectTags.splice(this.selectTags.indexOf(e), 1);
                    },
                    showDialogGrade: function() {
                        this.$refs.graceDialogGrade.open();
                    },
                    closeDialogGrade: function() {
                        this.$refs.graceDialogGrade.hide();
                    },
                    refundCancel: function(t) {
                        var i = this;
                        if ("card" == t) var a = "撤回取消订单，确认提交吗?"; else a = "撤回退款申请，确认提交吗?";
                        this.isRefundBtn = !0, e.showModal({
                            title: "提示",
                            content: a,
                            success: function(a) {
                                if (a.confirm) {
                                    e.showLoading({
                                        title: "提交中",
                                        mask: !0
                                    });
                                    var o = i.$xSign.sign("v5refund");
                                    i.$xRequest.request({
                                        url: "entry/wxapp/v5refund",
                                        data: {
                                            xgsign: o,
                                            oid: i.orderId,
                                            op: "refundCancel",
                                            action: t
                                        },
                                        success: function(t) {
                                            e.hideLoading(), e.showToast({
                                                title: "已取消退款申请",
                                                icon: "none"
                                            }), setTimeout(function() {
                                                i.isRefundBtn = !1, e.setStorageSync("touser", 1), i.detailData();
                                            }, 800);
                                        },
                                        fail: function(t) {
                                            e.hideLoading(), e.showToast({
                                                title: t.data.message,
                                                icon: "none"
                                            }), setTimeout(function() {
                                                i.isRefundBtn = !1, e.setStorageSync("touser", 1), i.detailData();
                                            }, 800);
                                        }
                                    });
                                } else a.cancel && (console.log("用户点击取消"), i.isRefundBtn = !1);
                            }
                        });
                    },
                    showDialogRefund: function(e) {
                        "weixin" == e && 0 == this.orderDetail.allprice ? (this.refundType = "zero", this.refundPlaceholder = "请输入取消原因，方便我们后续为您提供更好的服务") : (this.refundPlaceholder = "请输入取消原因，方便管理员为您尽快审核", 
                        this.refundType = e), this.$refs.graceDialogRefund.open();
                    },
                    closeDialogRefund: function() {
                        this.$refs.graceDialogRefund.hide();
                    },
                    refundInput: function(e) {
                        this.refundReason = e.detail.value;
                    },
                    refundPay: function() {
                        var t = this;
                        if (this.refundReason) {
                            if (this.closeDialogRefund(), "card" == this.refundType) var i = "取消订单需要管理员审核，确认提交吗?"; else i = "zero" == this.refundType ? "订单将直接取消，确认提交吗?" : "申请退款需要管理员审核，确认提交吗?";
                            this.isRefundBtn = !0, e.showModal({
                                title: "提示",
                                content: i,
                                success: function(i) {
                                    if (i.confirm) {
                                        e.showLoading({
                                            title: "提交中",
                                            mask: !0
                                        });
                                        var a = t.$xSign.sign("v5refund");
                                        t.$xRequest.request({
                                            url: "entry/wxapp/v5refund",
                                            data: {
                                                xgsign: a,
                                                oid: t.orderId,
                                                op: "refund",
                                                action: t.refundType,
                                                reson: t.refundReason
                                            },
                                            success: function(i) {
                                                JSON.parse(t.$Decrypt(i.data.data)), e.hideLoading(), (t.refundType = "zero") ? e.showToast({
                                                    title: "订单已取消，期待下次为您服务",
                                                    icon: "none"
                                                }) : e.showToast({
                                                    title: "提交成功,等待审核",
                                                    icon: "none"
                                                }), setTimeout(function() {
                                                    t.isRefundBtn = !1, e.setStorageSync("touser", 1), t.detailData();
                                                }, 800);
                                            },
                                            fail: function(i) {
                                                e.hideLoading(), e.showToast({
                                                    title: i.data.message,
                                                    icon: "none"
                                                }), setTimeout(function() {
                                                    t.isRefundBtn = !1, e.setStorageSync("touser", 1), t.detailData();
                                                }, 800);
                                            }
                                        });
                                    } else i.cancel && (t.isRefundBtn = !1, console.log("用户点击取消"));
                                }
                            });
                        } else e.showToast({
                            title: "请填写理由",
                            mask: !0,
                            icon: "none"
                        });
                    },
                    adminSubmit: function() {
                        var t = this;
                        if (/(^1[3|4|5|6|7|8|9][0-9]{9}$)/.test(this.usermobile)) if (this.userpword) {
                            e.showLoading({
                                title: "提交中",
                                mask: !0
                            });
                            var i = this.$xSign.sign("v4order_detail");
                            this.$xRequest.request({
                                url: "entry/wxapp/v4order_detail",
                                data: {
                                    op: "topword",
                                    xgsign: i,
                                    oid: this.sceneid,
                                    mbile: this.usermobile,
                                    mpword: this.userpword
                                },
                                success: function(i) {
                                    e.hideLoading(), t.graceFullLoading = !1, e.showToast({
                                        title: "提交成功",
                                        icon: "none"
                                    }), setTimeout(function() {
                                        e.reLaunch({
                                            url: "./order"
                                        });
                                    }, 800);
                                },
                                fail: function(i) {
                                    e.hideLoading(), t.graceFullLoading = !1, e.showToast({
                                        title: i.data.message,
                                        icon: "none"
                                    }), setTimeout(function() {
                                        e.reLaunch({
                                            url: "./order"
                                        });
                                    }, 800);
                                }
                            });
                        } else e.showToast({
                            title: "请填写授权码",
                            icon: "none",
                            duration: 800
                        }); else e.showToast({
                            title: "请输入正确的手机号码",
                            icon: "none",
                            duration: 800
                        });
                    },
                    showImgsPic: function(t, i) {
                        e.previewImage({
                            current: i,
                            urls: t
                        });
                    },
                    showImg: function() {
                        e.previewImage({
                            urls: [ this.orderDetail.uploadimg ]
                        });
                    },
                    showPerImg: function() {
                        e.previewImage({
                            urls: [ this.orderDetail.personnelimg ]
                        });
                    },
                    showUploadimgs: function() {
                        e.previewImage({
                            urls: this.uploadimgs
                        });
                    },
                    showperUploadimgs: function() {
                        e.previewImage({
                            urls: this.peruploadimgs
                        });
                    },
                    copyId: function() {
                        e.setClipboardData({
                            data: this.orderDetail.ordertid,
                            success: function() {
                                console.log("success");
                            }
                        });
                    },
                    detailData: function() {
                        var t = this, i = this.$xSign.sign("v4order_detail");
                        this.$xRequest.request({
                            url: "entry/wxapp/v4order_detail",
                            data: {
                                oid: this.orderId,
                                op: "detail",
                                xgsign: i
                            },
                            success: function(i) {
                                t.graceFullLoading = !1;
                                var a = JSON.parse(t.$Decrypt(i.data.data));
                                if (e.hideLoading(), 0 == i.data.errno && 1 == a.info) {
                                    if (t.iskefu = a.iskefu, t.bgColor = a.bgColor, t.textColor = a.textColor, t.orderDetail = a.order, 
                                    t.cancelName = 0 == t.orderDetail.allprice ? "取消订单" : "申请退款", t.addressDetail = a.addressDetail, 
                                    t.cancelTime = t.dateToStr(a.order.camceltime), t.payTime = t.dateToStr(a.order.paytime), 
                                    t.dispatchTime = t.dateToStr(a.order.dispatchtime), t.finishTime = t.dateToStr(a.order.finishtime), 
                                    t.gradeTime = t.dateToStr(a.order.gradetime), t.showHead = a.showhead, t.teckname = a.teckname, 
                                    t.isTail = a.istail, t.tailmate = a.tailmate, t.tailserv = a.tailserv, t.orderTags = a.ordertags, 
                                    a.personnel.headimg && (t.headimg = a.personnel.headimg), a.personnel.score > 0 && (t.perStar = a.personnel.score), 
                                    a.order.uploadimgs && (t.uploadimgs = a.order.uploadimgs.split(",")), a.order.uploadimgs && (t.uploadimgs = a.order.uploadimgs.split(",")), 
                                    a.order.gradeimgs && (t.gradeShowImgs = a.order.gradeimgs.split(",")), "" != a.personnel && (t.personnelName = a.personnel.name, 
                                    t.personnelMobile = a.personnel.mobile), t.addGoods = a.goodssettitle, t.goodsSelectList = a.goodslist, 
                                    t.totalprice = a.totalprice, t.allprice = a.allprice, t.cusset = a.cusset, 1 == t.orderDetail.isservicepay) {
                                        var o = parseFloat(a.allprice) + parseFloat(t.orderDetail.materialprice) + parseFloat(t.orderDetail.serviceprice);
                                        t.allprice = Math.round(100 * o) / 100;
                                    }
                                    t.showTel = a.isshowtel, t.isShowTeck = a.isshowteck, t.iscommentpic = a.iscommentpic, 
                                    t.tags = a.tags;
                                }
                            }
                        });
                    },
                    dateToStr: function(e) {
                        var t = 1e3 * parseInt(e), i = new Date(t);
                        return i.getUTCFullYear() + "-" + (i.getUTCMonth() + 1) + "-" + i.getUTCDate() + " " + i.getHours() + ":" + i.getMinutes() + ":" + i.getSeconds();
                    },
                    makePhoneCall: function() {
                        e.makePhoneCall({
                            phoneNumber: this.personnelMobile
                        });
                    },
                    onChange: function(e) {
                        this.grade = e;
                    },
                    textareaAInput: function(e) {
                        this.grade_remarks = e.detail.value;
                    },
                    confirmPay: function() {
                        var t = this;
                        if (e.showLoading({
                            title: "支付中",
                            mask: !0
                        }), 1 == this.orderDetail.isservice && 1 == this.orderDetail.isservicepay) return e.hideLoading(), 
                        void e.showToast({
                            title: "尾款已支付，请勿重复支付",
                            icon: "none",
                            duration: 1800
                        });
                        if (1 == this.orderDetail.isservice && 0 == this.orderDetail.serviceprice && 0 == this.orderDetail.materialprice && 0 == this.orderDetail.needprice) return e.hideLoading(), 
                        void e.showToast({
                            title: "尾款为0，无需支付，请点击完成订单",
                            icon: "none",
                            duration: 1800
                        });
                        var i = parseFloat(this.orderDetail.serviceprice) + parseFloat(this.orderDetail.materialprice) + parseFloat(this.orderDetail.needprice), a = Math.round(100 * i) / 100;
                        this.isPay = !0;
                        var o = this.$xSign.sign("v4order_detail");
                        this.$xRequest.request({
                            url: "entry/wxapp/v4order_detail",
                            data: {
                                xgsign: o,
                                oid: this.orderId,
                                payprice: a,
                                op: "toservicepay"
                            },
                            success: function(i) {
                                var a = JSON.parse(t.$Decrypt(i.data.data));
                                i.data && a && !i.data.errno && wx.requestPayment({
                                    timeStamp: a.timeStamp,
                                    nonceStr: a.nonceStr,
                                    package: a.package,
                                    signType: "MD5",
                                    paySign: a.paySign,
                                    success: function(i) {
                                        e.hideLoading(), e.showToast({
                                            title: "支付成功",
                                            icon: "none",
                                            duration: 800
                                        }), e.setStorageSync("touser", 1), t.detailData();
                                    },
                                    fail: function(i) {
                                        e.hideLoading(), t.isPay = !1, "requestPayment:fail cancel" == i.errMsg && (e.showToast({
                                            title: "支付取消",
                                            icon: "none",
                                            duration: 800
                                        }), e.setStorageSync("touser", 1), t.detailData());
                                    }
                                });
                            },
                            fail: function(i) {
                                e.hideLoading(), t.isPay = !1, wx.showModal({
                                    title: "系统提示",
                                    content: i.data.message ? i.data.message : "错误",
                                    showCancel: !1,
                                    success: function(e) {
                                        e.confirm;
                                    }
                                });
                            }
                        });
                    },
                    gradeConfirm: function() {
                        var t = this;
                        if (0 != this.orderDetail.isservice) if (0 != this.orderDetail.marketprice || 1 != this.orderDetail.isadminadd) {
                            var i = parseFloat(this.orderDetail.serviceprice) + parseFloat(this.orderDetail.materialprice);
                            1 == this.orderDetail.isservice && 0 == this.orderDetail.isservicepay && i > 0 ? e.showToast({
                                title: "请先支付尾款",
                                icon: "none",
                                duration: 1800
                            }) : 5 != this.orderDetail.status || 0 != this.grade ? (this.grade_remarks || this.selectedimgs.length > 0 || this.selectTags.length > 0) && 0 == this.grade ? e.showToast({
                                title: "请选择评分",
                                icon: "none",
                                duration: 1800
                            }) : (this.isRes = !0, 0 == this.grade ? e.showModal({
                                title: "提示",
                                content: "现在不进行评价吗？",
                                success: function(i) {
                                    if (i.confirm) {
                                        t.closeDialogGrade();
                                        var a = t.$xSign.sign("v4order_detail");
                                        t.$xRequest.request({
                                            url: "entry/wxapp/v4order_detail",
                                            data: {
                                                oid: t.orderId,
                                                op: "grade",
                                                score: t.grade,
                                                orderstatus: t.orderDetail.status,
                                                score_remark: t.grade_remarks,
                                                xgsign: a
                                            },
                                            success: function(i) {
                                                0 == i.data.errno && (e.showToast({
                                                    title: i.data.message,
                                                    icon: "none",
                                                    duration: 1200
                                                }), t.isRes = !1, e.setStorageSync("touser", 1), t.detailData());
                                            },
                                            fail: function(i) {
                                                t.isRes = !1, e.showToast({
                                                    title: i.data.message,
                                                    icon: "none",
                                                    duration: 1200
                                                }), e.setStorageSync("touser", 1), t.detailData();
                                            }
                                        });
                                    } else i.cancel && (t.isRes = !1);
                                }
                            }) : e.showModal({
                                title: "提示",
                                content: "确认提交吗？",
                                success: function(e) {
                                    e.confirm ? (t.closeDialogGrade(), t.selectedimgs.length > 0 ? t.$refs.selectimgandupload.upload() : t.updateGrade()) : e.cancel && (t.isRes = !1);
                                }
                            })) : e.showToast({
                                title: "请选择评分",
                                icon: "none",
                                duration: 1800
                            });
                        } else e.showToast({
                            title: "您还有未支付项目",
                            icon: "none",
                            duration: 1200
                        }); else e.showToast({
                            title: "请等待" + this.teckname + "确认完工",
                            icon: "none",
                            duration: 1200
                        });
                    },
                    imgsChange: function(e) {
                        this.selectedimgs = e;
                    },
                    imgLoaded: function(t) {
                        e.showLoading({
                            title: "提交中",
                            mask: !0
                        });
                        var i = new Array();
                        if (t.length > 0) {
                            for (var a = 0; a < t.length; a++) i[a] = t[a].url;
                            this.gradeimgs = i.join(","), this.updateGrade();
                        }
                    },
                    uploaderror: function() {
                        this.isRes = !1, this.showDialogGrade(), console.log("上传过程遇到错误");
                    },
                    updateGrade: function() {
                        var t = this, i = this.$xSign.sign("v4order_detail"), a = "";
                        this.selectTags.length > 0 && (a = this.selectTags.join(",")), this.$xRequest.request({
                            url: "entry/wxapp/v4order_detail",
                            data: {
                                oid: this.orderId,
                                op: "grade",
                                score: this.grade,
                                orderstatus: this.orderDetail.status,
                                score_remark: this.grade_remarks,
                                gradeimgs: this.gradeimgs,
                                gradelength: this.grade_remarks.length,
                                tags: a,
                                xgsign: i
                            },
                            success: function(i) {
                                t.isRes = !1, 0 == i.data.errno && (e.showToast({
                                    title: i.data.message,
                                    icon: "none",
                                    duration: 1200
                                }), e.setStorageSync("touser", 1), t.detailData());
                            },
                            fail: function(i) {
                                t.isRes = !1, e.showToast({
                                    title: i.data.message,
                                    icon: "none",
                                    duration: 1200
                                }), e.setStorageSync("touser", 1), t.detailData();
                            }
                        });
                    }
                }
            };
            t.default = o;
        }).call(this, i("543d").default);
    },
    "109a": function(e, t, i) {
        "use strict";
        i.r(t);
        var a = i("0d0d"), o = i.n(a);
        for (var s in a) "default" !== s && function(e) {
            i.d(t, e, function() {
                return a[e];
            });
        }(s);
        t.default = o.a;
    },
    4226: function(e, t, i) {
        "use strict";
        i.r(t);
        var a = i("4b85"), o = i("109a");
        for (var s in o) "default" !== s && function(e) {
            i.d(t, e, function() {
                return o[e];
            });
        }(s);
        i("cda7");
        var r = i("f0c5"), n = Object(r.a)(o.default, a.b, a.c, !1, null, null, null, !1, a.a, void 0);
        t.default = n.exports;
    },
    "4b85": function(e, t, i) {
        "use strict";
        i.d(t, "b", function() {
            return o;
        }), i.d(t, "c", function() {
            return s;
        }), i.d(t, "a", function() {
            return a;
        });
        var a = {
            gracePage: function() {
                return i.e("graceUI/components/gracePage").then(i.bind(null, "1915"));
            },
            graceFullLoading: function() {
                return i.e("graceUI/components/graceFullLoading").then(i.bind(null, "7669"));
            },
            graceShade: function() {
                return i.e("graceUI/components/graceShade").then(i.bind(null, "6b7b"));
            },
            divider: function() {
                return i.e("components/divider/divider").then(i.bind(null, "bdb7"));
            },
            graceStar: function() {
                return i.e("graceUI/components/graceStar").then(i.bind(null, "829b"));
            },
            xmgStar: function() {
                return i.e("components/xmgStar/xmgStar").then(i.bind(null, "1027"));
            },
            graceDialog: function() {
                return i.e("graceUI/components/graceDialog").then(i.bind(null, "8d15"));
            },
            graceSelectImgAndUpload: function() {
                return Promise.all([ i.e("common/vendor"), i.e("graceUI/components/graceSelectImgAndUpload") ]).then(i.bind(null, "d7ef"));
            }
        }, o = function() {
            var e = this, t = (e.$createElement, e._self._c, e.__map(e.tags, function(t, i) {
                return {
                    $orig: e.__get_orig(t),
                    g0: e.selectTags.indexOf(t)
                };
            }));
            e.$mp.data = Object.assign({}, {
                $root: {
                    l0: t
                }
            });
        }, s = [];
    },
    b2ea: function(e, t, i) {
        "use strict";
        (function(e) {
            function t(e) {
                return e && e.__esModule ? e : {
                    default: e
                };
            }
            i("4e1e"), t(i("66fd")), e(t(i("4226")).default);
        }).call(this, i("543d").createPage);
    },
    cda7: function(e, t, i) {
        "use strict";
        var a = i("fafb");
        i.n(a).a;
    },
    fafb: function(e, t, i) {}
}, [ [ "b2ea", "common/runtime", "common/vendor" ] ] ]);